
package ahuy.edu.basic;

import java.util.logging.Level;
import java.util.logging.Logger;


public class Unit32_Throw_throws {
    public static void main(String[] args) {
        try {
            Building b= new Building();
            b.go();
        } catch (InterruptedException ex) {
            Logger.getLogger(Unit32_Throw_throws.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
class MyException extends Exception{
    
}
class Building {
    public void show() throws MyException{
        int numberConnection = 0;
        //do something
        if(numberConnection > 100){
        
       throw new MyException();
        }
    }
    public void go() throws InterruptedException{
       Thread.sleep(1000);
    }
}